/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;


public class DBconnection {
 
    //Connection conn = null;
        
    public void DBconnection() throws ClassNotFoundException, SQLException
    {
        
    }
   
    public Connection getConnection() throws SQLException
    {    /*
        String url = "jdbc:oracle:thin:@aptproj.c1svllbiwaey.us-east-1.rds.amazonaws.com:1521:APTPROJ";
     
        //properties for creating connection to Oracle database
        Properties props = new Properties();
        props.setProperty("user", "rdayto3");
        props.setProperty("password", "dbpassword");
     
        //creating connection to Oracle database using JDBC
        Connection conn = DriverManager.getConnection(url,props);  
        * */
        
        String url = "jdbc:mysql://triton.towson.edu:5030/rdayto3db";
        String user = "rdayto3";
        String pw = "Cosc*dqk7";
        Connection conn = DriverManager.getConnection( url, user, pw );   
        /*
        
         String url = "jdbc:mysql://aptproject.c1svllbiwaey.us-east-1.rds.amazonaws.com:3306/";
         String userName = "rdayto3";
         String password = "dbpassword";
         String dbName = "APTPROJ";
         String driver = "com.mysql.jdbc.Driver";
         Connection conn = DriverManager.getConnection(url + dbName, userName, password);
         */
            
        return conn;
    }

}




